package pcsr.drivers.nxtDriver;

enum NXTActuatorMode {
	MOTORON( 1 ),
	BRAKE( 2 ),
	REGULATED( 4 );
	
	private int modeValue;
	
	private NXTActuatorMode( int value ) {
		/*
		if(value < 0 || value > 2)
		{
			throw new IllegalArgumentException("NXTActuatorMode values between 0 and 2.");
		}
		*/
		modeValue = value;
	}
		
	public int GetModeID( )
	{
		return modeValue;
	}
	
	public static NXTActuatorMode GetModeByValue( int modevalue )
	{
		switch (modevalue) 
		{
			case 0:
				return MOTORON;
			case 2:
				return BRAKE;
			case 4:
				return REGULATED;
		}
		
		return null;
	}
}
